
<div class="fadeIn">
    <br>
    <ol class="breadcrumb">
    <li class="active"><span class="glyphicon glyphicon-home" style="color:#23527c"></span>&nbsp;<mainpage></mainpage></li>
    <li class="active">监控工作台 / 环境监控 / redis监控</li>
</ol> 
    <div class="marT15 marB15 clearfix">
       <form method="post" id="form" action="redismon/createExcle">
        <div class="left marR10">
            <span class="">角色：</span>
             <select class="form-control1" id="hostName" name="role" ng-model='searchData.role'><!-- ng-options="item.objId as item.objName for item in allMainName" -->
               <option value=''>全部</option>
               <option value='master'>master</option>
               <option value='slave'>slave</option>
             </select>
        </div>
         </form>
        <a class=" btn btn-primary btn-sm left" ng-click='search()'><span class="glyphicon glyphicon-search"></span></a> 

        <!-- <div class="right" style="position:relative">
               <form method="post" id="form" action="redismon/createExcle"></form>
                <button class="btn btn-primary btn-sm" ng-click='outExcel()'><img style="width:25px; height:20px;" src="img/excel.png">导出表格<span ng-style='loadStyle' class="outExcelLoad"><img  src="img/load.gif"></span>
                </button>
        </div>  -->    
    </div>
        

    <div id="str-line"></div>
   <!--  <div class="rec-box bg-info">
       <div class="row">
        <span class="col-sm-2">集群健康状态:</span>
        <span class="col-sm-2">集群分片数:</span>
        <span class="col-sm-2">集群节点数:</span>
        <span class="col-sm-2">数据槽分配数:</span>
        <span class="col-sm-2">下线数据槽数:</span>
        <button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#add1" ng-click='addConfig()'><i class="icon-leaf"></i>监控配置</button>
       </div>
    
    </div> -->
    <!-- <div id="str-line"></div> -->


<div class="table-box">

    <table class="table table-bordered table-striped text-center bg-info">
        <thead >
        <tr class="info">
            <th class="text-center">序号</th>
            <th class="text-center">角色</th>
            <th class="text-center">ip</th>
            <th class="text-center">主(从)</th>
            <th class="text-center">连接个数</th>
            <th class="text-center">连接使用率</th>
            <th class="text-center">使用内存</th>
            <th class="text-center">内存使用率</th>
            <th class="text-center">预警数</th>
            <th class="text-center">负责人</th>
            <th class="text-center">手机号码</th>
            <th class="text-center">邮箱</th>

        </tr>
        </thead>
        <tbody>
        <tr ng-repeat='item in result'>
            <td>{{$index+1}}</td>
            <td>{{item.role}}</td>
            <td class="w85">
                <a >{{item.ip}}</a><!-- data-toggle="modal" data-target="#add2" ng-click='showMethod(item.redisId)' -->           
            </td>
            <td class="w85">
                <a >{{item.rltip}}</a> <!-- data-toggle="modal" data-target="#add2"  -->
            </td>
            <td class="w85">{{item.links}}</td>
            <td class="w115">{{item.linkuse}}</td>
            <td class="w85">{{(item.pidmemuse/1024/1024/1024).toFixed(2)}}</td>  <!--  使用内存，单位显示为G -->
            <td class="w115">{{item.memuse}}</td>
            <td class="w70">{{item.warnCount}}</td>
            <td class="w70">{{item.userName}}</td>
            <td class="w85">{{item.phoneNumber}}</td>
            <td class="w70">{{item.mailBox}}</td>
        </tr>
        
        </tbody>
    </table>
  </div>


    <page></page>
</div>
<!-- 显示信息模态框 -->
<div class="modal fade" id="add2" tabindex="-1" role="dialog" aria-labelledby="add12">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4>信息</h4>
                </div>
                <div class="modal-body">
                 <table class="table table-bordered table-hover">
                     <tr class="info" ng-repeat='item in message'>
                         <th>{{item.key1}}</th>
                         <td>{{item.value1}}</td>
                         <th>{{item.key2}}</th>
                         <td>{{item.value2}}</td>
                         <th>{{item.key3}}</th>
                         <td>{{item.value3}}</td>
                     </tr>
                     <!-- <tr>
                         <th>端口</th>
                         <td>66535</td>
                         <th>主(从)角色ip</th>
                         <td>192.168.32.0</td>
                         <th>主(从)角色端口</th>
                         <td>192.168.12.1<td>
                     </tr>
                     <tr class="info">
                         <th>客户连接数</th>
                         <td></td>
                         <th>连接使用率</th>
                         <td></td>
                         <th>拒绝连接数</th>
                         <td></td>
                     </tr>
                     <tr>
                         <th>分配内存</th>
                         <td></td>
                         <th>内存使用率</th>
                         <td></td>
                         <th>进程使用内存</th>
                         <td></td>
                     </tr>
                     <tr class="info">
                         <th>内存碎片率</th>
                         <td></td>
                         <th>键个数</th>
                         <td></td>
                         <th>有生命周期键个数</th>
                         <td></td>
                     </tr>
                      <tr>
                         <th>淘汰键个数</th>
                         <td></td>
                         <th>过期淘汰键个数</th>
                         <td></td>
                         <th>处理命令数</th>
                         <td></td>
                     </tr>
                     <tr class="info">
                         <th>每秒处理命令数</th>
                         <td></td>
                         <th>请求命令数</th>
                         <td></td>
                         <th>请求命中率</th>
                         <td></td>
                     </tr>
                      <tr>
                         <th>分配内存</th>
                         <td></td>
                         <th>内存使用率</th>
                         <td></td>
                         <th>进程使用内存</th>
                         <td></td>
                     </tr>
                     <tr class="info">
                         <th>内存碎片率</th>
                         <td></td>
                         <th>键个数</th>
                         <td></td>
                         <th>有生命周期键个数</th>
                         <td></td>
                     </tr>
                      <tr>
                         <th>最近一次fork阻塞的微秒数</th>
                         <td></td>
                         <th>redis网络入口流量字节数</th>
                         <td></td>
                         <th>网络入口kps</th>
                         <td></td>
                     </tr>
                     <tr class="info">
                         <th>redis网络出口流量字节数</th>
                         <td></td>
                         <th>网络出口kps</th>
                         <td></td>
                         <th>慢查询日志个数</th>
                         <td></td>
                     </tr>
                      <tr>
                         <th>慢查询日志最长耗时值</th>
                         <td></td>
                         <th>最近一次rdb持久化状态</th>
                         <td></td>
                         <th>最近一次rdb持久化耗时</th>
                         <td></td>
                     </tr>
                     <tr class="info">
                         <th>最近一次rdb持久化写入命令数</th>
                         <td></td>
                         <th>离最近一次成功rdb持久化时长(秒)</th>
                         <td></td>
                         <th>复制连接状态</th>
                         <td></td>
                     </tr>
                      <tr>
                         <th>复制连接断开时长(秒)</th>
                         <td></td>
                         <th>主从数据未同步时长(秒)</th>
                         <td></td>
                         <th>未发送REPLCONF时长</th>
                         <td></td>
                     </tr>
                     <tr class="info">
                         <th>复制积压缓存大小</th>
                         <td></td>
                         <th></th>
                         <td></td>
                         <th></th>
                         <td></td>
                     </tr> -->
                 </table>

                </div>
               
            </div>
        </div>
    </div>
    <!-- 显示信息模态框结束 -->
<!--添加程序弹窗-->
<div class="modal fade" id="add1" tabindex="-1" role="dialog" aria-labelledby="add1">
    <form name="form">
    <div class="modal-dialog" style="width:780px;" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="add11">redis监控配置</h4>
            </div>
            <div class="modal-body">           
            <div class="input-group marB15" style="width:310px;">
                <span class="input-group-addon">redis监控节点选择：</span>
                <select id='redisId' class="form-control" 
                ng-model='addData.redisId' 
                ng-change='changeRedis()'
                ng-options='item.redisId as item.redisIP for item in redisIps'></select>
            </div> 
          <table class="table table-bordered table-striped table-hover bg-info">
                <thead>
                <tr class="bg-info"><td colspan="7">预警接收人员配置：</td></tr>
                <tr>
                    <td>序号</td>
                    <td>预警接收人</td>
                    <td>手机</td>
                    <td>邮箱</td>
                    <td>人员类型</td>
                    <td>接收预警等级</td>
                    <td ng-style='addstyle'>操作</td>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat='item in addData.alarmusers'>
                    <td>{{$index+1}}</td>
                    <td>
                    <select class="form-control line3" class="receiveUser" 
                    ng-model='item.rceId' 
                    ng-disabled='isDisabled'
                    ng-change='changeRecUser($index)'
                    ng-options='i.rceId as i.receiveUser for i in alarmusers'></select>
                    </td>
                    <td><input type="text" class="form-control line3" ng-model='item.phone'></td>
                    <td><input type="text" class="form-control line3" ng-model='item.email'></td>
                    <td><select class="form-control line3" style="width:70px;" ng-model='item.userType'>
                    <option value="1">责任人</option>
                    <option value="0">关注人</option>
                    </select></td>
                    <td>
                        <label><input type="checkbox"                         
                        ng-model='item.recAlarmLevel1'
                        >1级</label>
                        <label class="marL10 marR10"><input type="checkbox"                       
                        ng-model='item.recAlarmLevel2'
                        >2级</label>
                        <label><input type="checkbox"                       
                        ng-model='item.recAlarmLevel3'
                        >3级</label>
                    </td>
                    <td ng-style='addstyle'><button class="btn btn-primary btn-sm" ng-click='delRecevier($index)'>删除</button></td>
                </tr>
                </tbody>
                
                <tfoot ng-style='addstyle'>
                 <tr><td> <a title='添加' class="glyphicon glyphicon-plus" ng-click='addRecevier()'></a></td></tr>
                </tfoot>
                
            </table>
            <table class="table table-bordered table-hover">
                <tr>
                    <td>序号</td>
                    <td>监控指标名称</td>
                    <td>阀值上限</td>
                    <td>阀值下限</td>
                    <td>监控说明</td>
                    <td>操作</td>
                </tr>
                <tr class="bg-info" ng-repeat='item in addData.indexnames'>
                    <td>{{$index+1}}</td>
                    <td>
                       <select  class="form-control line3"  
                        ng-disabled='isDisabled'
                        ng-model='item.keyId'
                        ng-options='i.keyId as i.keyNameCn for i in indexnames'
                        ></select>
                    </td>
                    <td><input type="text" class="form-control line3" ng-model='item.upperLimit'></td>
                    <td><input type="text" class="form-control line3" ng-model='item.lowerLimit'></td>
                    <td><input type="text" class="form-control line3" ng-model='item.remark'></td>
                    <td><a class="btn btn-sm btn-primary" ng-click='delIndex($index)'>删除</a></td>
                </tr>
                <tr>
                  <td>
                  <a title='添加' class="glyphicon glyphicon-plus" ng-click='addIndex()'></a></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                </tr>
            </table>       
        </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary btn-sm" ng-click='editSave()'>保存</button>
            </div>
        </div>
    </div>
    </form>
</div>
<!-- 加载框 -->
  <span class='loaded' ng-show='loaded'><img  src="img/load.gif"></span>
<!-- 加载框 完成-->
